﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace B4Deal.Models
{
    public class Product
    {
        private float value;

        public float Value
        {
            get { return this.value; }
            set { this.value = value; }
        }
        private float sale;

        public float Sale
        {
            get { return sale; }
            set { sale = value; }
        }
        private float save;

        public float Save
        {
            get { return save; }
            set { save = value; }
        }
        private int nPeople;

        public int NPeople
        {
            get { return nPeople; }
            set { nPeople = value; }
        }
        private DateTime date;

        public DateTime Date
        {
            get { return date; }
            set { date = value; }
        }
        private int vote;

        public int Vote
        {
            get { return vote; }
            set { vote = value; }
        }
        private string title;

        public string Title
        {
            get { return title; }
            set { title = value; }
        }

        private string sourceImage;

        public string SourceImage
        {
            get { return sourceImage; }
            set { sourceImage = value; }
        }

        private string[] special;

        public string[] Special
        {
            get { return special; }
            set { special = value; }
        }
        private int index;

        public int Index
        {
            get { return index; }
            set { index = value; }
        }

        public Product(float _value, float _sale, float _save, int _npeople, int _vote, string _title, string _srcImg, string[] _spec)
        {
            this.value = _value;
            this.sale = _sale;
            this.save = _save;
            this.nPeople = _npeople;
            this.vote = _vote;
            this.title = _title;
            this.sourceImage = _srcImg;
            this.special = _spec;
        }
        private string ddd;

        public string Ddd
        {
            get { return ddd; }
            set { ddd = value; }
        }
        const string constUrl = "http://sandbox.nganluong.vn/button_payment.php?receiver=trongnghia09ctt2@gmail.com";
        public string Url(string productname, string price, string returnUrl, string comment)
        {
            string url = constUrl;
            url += "&product_name=" + productname;
            url += "&price=" + price;
            url += "&return_url=" + returnUrl;
            url += "&comments=" + comment;
            return url;
        }
        NL_Checkout nl_checkout = new NL_Checkout();
        public string checkoutUrl(String return_url, String receiver, String transaction_info, String order_code, String price)
        {
            return nl_checkout.buildCheckoutUrl(return_url, receiver, transaction_info, order_code, price);
        }
    }
}